# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  
  def google_bar_chart(title, data)
    # TODO: add width, height
#    chartString = "<img src=\"http://chart.apis.google.com/chart?"
    
    # replace title with space
    chartSize = "chs=500x100"
    chartType = "cht=bvs"
    
    # TODO: urlencoding
    chartTitle = "chtt=" + title
 
    chartData = "chd=t:10,30,40,50"
    
    "<img src=\"http://chart.apis.google.com/chart?" + chartType + "&" + chartSize + "&" + chartTitle + "&"  + chartData + "\" />"

    
  end
  
  
  
end
